#ifndef MEASUREPAGE_P1_H
#define MEASUREPAGE_P1_H

#include <QWidget>
#include "Charts/measurepagecharts.h"
#include "userinfoinputdialog.h"
#include "measureresultpage.h"
#include "Beans/userinfobeab.h"
#include "QMediaPlayer"
#include <QAudioOutput>
#include "thread/threadwork.h"
namespace Ui {
class MeasurePage_P1;
}

class MeasurePage_P1 : public QWidget
{
    Q_OBJECT

public:
    explicit MeasurePage_P1(QWidget *parent = nullptr);
    ~MeasurePage_P1();
    void InitialChartView();

    void setBg();
private slots:

    void on_bt_Start_clicked();

    void on_bt_End_clicked();

    void getPPGData(double ppg1,double appg1,double ppg2,double appg2);

    void getSPOXData(double spox,int p);

    void getHRData(unsigned char hr,int p);

    void getRRData(int RR,int p);

    void getProgressData(int p,int persion);

    void getOver(int p);

    void InitialControl();

    void getUserInfoFromDialog(UserInfoBeab uib);

private:
    Ui::MeasurePage_P1 *ui;
    MeasurePageCharts MPC;
    QChart *ppg_Chart;
    QChart *appg_Chart;
    QChart *hrv_Chart;
    UserInfoInputDialog *uid;
    MeasureResultPage *mrp;
    UserInfoBeab CurrentUser;
    int pos;
    QMediaPlayer *myplayer ;
    QAudioOutput *audioOutput;
    ThreadWork *threadWork;



signals:
    void Initial();
    void SendUserInfoToResult(UserInfoBeab uid);
    void sendStartOrStop(bool b,int p);
    void sendUserInfo2Thread(UserInfoBeab uib,int p);
};

#endif // MEASUREPAGE_P1_H
